//
//  UIView+XWExtension.m
//  CGWSWW
//
//  Created by lanou3g on 16/8/12.
//  Copyright © 2016年 CXG. All rights reserved.
//

#import "UIView+XWExtension.h"

@implementation UIView (XWExtension)
-(void)setXW_x:(CGFloat)XW_x{
    CGRect frame = self.frame;
    frame.origin.x = XW_x;
    self.frame =frame;
}
-(CGFloat)XW_x{
    return self.frame.origin.x;
}
-(void)setXW_y:(CGFloat)XW_y{
    CGRect frame = self.frame;
    frame.origin.y= XW_y;
    self.frame =frame;
}
-(CGFloat)XW_y{
    return self.frame.origin.y;
};

-(void)setXW_size:(CGSize)XW_size{
    CGRect  frame =self.frame;
    frame.size = XW_size;
    self.frame =frame;
    
}
-(CGSize)XW_size{
    return self.frame.size;
}

-(void)setXW_high:(CGFloat)XW_high{
    CGRect  frame =self.frame;
    frame.size.height =XW_high;
    self.frame =frame;
}
-(CGFloat)XW_high{
    return self.frame.size.height;
}
-(void)setXW_width:(CGFloat)XW_width{
    CGRect  frame =self.frame;
    frame.size.width = XW_width;
    self.frame =frame;
}
-(CGFloat)XW_width{
    return self.frame.size.width;
}
-(void)setXW_centerX:(CGFloat)XW_centerX{
    CGPoint center =self.center;
    center.x =XW_centerX;
    self.center =center;
}
-(CGFloat)XW_centerX{
    return self.center.x;
}
-(void)setXW_centerY:(CGFloat)XW_centerY{
    CGPoint center = self.center;
    center.y =XW_centerY;
    self.center =center;
}
-(CGFloat)XW_centerY{
    return self.center.y;
}
-(void)setXW_right:(CGFloat)XW_right{
    self.XW_x =XW_right-self.XW_width;
    
}
-(CGFloat)XW_right{
    return CGRectGetMaxX(self.frame);
}
-(void)setXW_left:(CGFloat)XW_left{
    self.XW_x = XW_left;
}
-(CGFloat)XW_left{
    return self.XW_x;
}
-(void)setXW_top:(CGFloat)XW_top{
    self.XW_y = XW_top;
}
-(CGFloat)XW_top{
    return self.XW_y;
}
-(void)setXW_bottom:(CGFloat)XW_bottom{
    self.XW_y = XW_bottom -self.XW_high;
}
-(CGFloat)XW_bottom{
    return CGRectGetMaxY(self.frame);
}
@end
